1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method which can carry out suitable contour compensation on input image data and which may be applied to a video camera, digital still camera, or other apparatus and relates to a camera apparatus capable of carrying out suitable contour compensation and taking a high quality image.
2. Description of the Related Art
The recent rapid improvements in the performance of charge coupled devices (CCD) have led to the spread of video cameras, digital still cameras, scanners, and other apparatuses utilizing such solid state imaging elements for inputting images.
The image signal obtained by a CCD or other solid state imaging element deteriorates in high frequency response due to the properties of the optical parts before entering the solid state imaging elements. The high frequency components therein are cut in order to avoid generating a false signal.
Accordingly, if the signal directly output from the solid state imaging element itself is used, the resultant image becomes blurred due to the low proportion of the high frequency components.
To avoid this, normally processing called xe2x80x9ccontour compensationxe2x80x9d is carried out. Contour compensation is generally performed by extracting just the high frequency component from the image signal, appropriately amplifying it to generate a contour compensation signal, and adding the contour compensation signal to the original image signal.
The above method for generating a contour compensation signal of the related art, however, is based on use of a linear filter, so there was the disadvantage that an overshoot or undershoot occurs near an edge where the brightness changes is steps and therefore the image becomes too bright or too dark near the edge. Therefore, there was the disadvantage that the contours are enhanced, but the image tends to become unnatural.
To solve the disadvantage, it can be considered to introduce a circuit which performs edge detection and other processing so as prevent excessive compensation at the edge portions of the image. Such a circuit, however, becomes complicated and large. Therefore, the overall apparatus becomes large and costly.
An object of the present invention is to provide an image processing apparatus which can avoid excessive compensation and suitably compensate a contour without making the apparatus larger.
Another object of the present invention is to provide an image processing method capable of preventing excessive compensation and carrying out suitable contour compensation.
Still another object of the present invention is to provide a video camera, still camera, or other camera apparatus which can prevent excessive compensation, carry out suitable contour compensation, and take a high quality image without increasing the size of the device.
According to a first aspect of the present invention, there is provided an image processing apparatus, comprising a first image processing means for carrying out desired image processing on input image data, a pixel detecting means for detecting a change in the relationship of magnitude of values between a pixel before and after image processing based on the values of pixels of the processed image data and the input original image data, and a selecting means for selecting a pixel where there is no change in the relationship of magnitude between the two sets of image data based on the results of the detection as a pixel which has been suitably processed.
Preferably, the image processing is image enhancement processing.
More preferably, the first image processing means comprises a compensation value detecting means for detecting a compensation value for carrying out the image enhancement processing on each pixel of the input ,original image data and a pixel generating means for adding the detected compensation value to the value of the corresponding pixel of the input original image to generate compensated pixel data to generate enhanced image data.
More preferably, the selecting means outputs the compensation value of the selected pixel.
Preferably, the selecting means outputs the compensated pixel data for a selected pixel and the pixel data of the input original image data for a not selected pixel as image data of the result of the image enhancing processing.
Preferably, the apparatus further includes a second image processing means for carrying out second image enhancing processing with less effect than the first image enhancing processing on the input image data and the selecting means outputs the compensated pixel data of the first image processing means for a selected pixel and the compensated pixel data of the second image processing means for a not selected pixel as image data of the result of the image enhancing processing.
Preferably, the pixel detecting means performs primary differentiation on each pixel value of both the enhanced image data and the original image data and detects a change of the sign of the differentiated values to detect a change in the relationship of the two pixel values and the selecting means selects a pixel where there is no change in sign of the differentiated value as a suitably enhanced pixel.
Alternatively, the pixel detecting means carries out subtraction for each pixel value of both the enhanced image data and the original image data from each adjacent pixel of the pixel and detects a change of the sign of the value of the remainder to detect a change in the relationship of the pixel values and the selecting means selects a pixel where there is no change in sign of the remainder as a suitably enhanced pixel.
Preferably, the image enhancing processing is processing to enhance the contour of an image.
According to a second aspect of the invention, there is provided an image processing method including the steps of carrying out desired image processing on input image data, comparing values of the processed image data and the input original image data for each pixel, detecting a change in the relationship of magnitude of values between pixels, and selecting a pixel where there is no change in the relationship of magnitude between the two sets of image data based on the results of the detection as a pixel which has been suitably processed.
Preferably, the image processing is image enhancement processing.
Preferably, the image processing step comprises detecting a compensation value for carrying out the image enhancement processing on each pixel of said input original image data and adding the detected compensation value to the value of the corresponding pixel of the input original image to generate compensated pixel data to generate enhanced image data.
Preferably, the method outputs the compensated pixel data for a selected pixel and the pixel data of said input original image data for a not selected pixel as image data of the result of the image enhancing processing.
Preferably, the method further comprises carrying out second image enhancing processing with less effect than the first image enhancing processing on the input image data and outputting the compensated pixel data of the first image processing for a selected pixel and the compensated pixel data of the second image processing for a not selected pixel as image data of the result of the image enhancing processing.
Preferably, the step of detecting a change in the pixel performs primary differentiation on each pixel value of both the enhanced image data and the original image data and detects a change of the sign of the differentiated values to detect a change in the relationship of the two pixel values and the selecting step selects a pixel where there is no change in sign of the differentiated value as a suitably enhanced pixel.
Alternatively, the step of detecting a change in the pixel carries out subtraction for each pixel value of both the enhanced image data and the original image data from each adjacent pixel of the pixel and detects a change of the sign of the value of the remainder to detect a change in the relationship of the pixel values and the selecting step selects a pixel where there is no change in sign of the remainder as a suitably enhanced pixel.
Preferably, the image enhancing processing is processing to enhance the contour of an image.
According to a third aspect of the present invention, there is provided a camera apparatus comprising an image input means for taking a desired image and inputting the image data, an image processing means for carrying out image enhancing processing on the input image data comprising a first image processing means for carrying out the image enhancing processing on the input image data, a pixel detecting means for comparing pixel values of the enhanced image data and the input original image data for each pixel and detecting a change of the relationship of magnitude of the pixel value between pixels, and a selecting means for selecting a pixel where there is no change in the relationship of magnitude as a suitably processed pixel based on the result of the detection, a coding means for coding the processed image data, and a recording means for recording the coded image data.
Preferably, the selecting means of the image processing means outputs the compensated pixel data for a selected pixel and the pixel data of the input original image data for a not selected pixel as image data of the image enhancing processing.
Preferably, the image processing means further comprises a second image processing means for carrying out second image enhancing processing with less effect than the first image enhancing processing on the input image data and the selecting means outputs the compensated pixel data of the first image processing means for a selected pixel and the compensated pixel data of the second image processing means for a not selected pixel as image data of the result of the image enhancing processing.
Preferably, the image enhancing processing is processing to enhance the contour of the image.
Preferably, the image input means is a device to take a still picture and the recording means records the image data in a memory card.
Alternatively, the image input means is a device to take a moving picture and the recording means records the image data on video tape.